﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace FCMGAAI
{
    public static class UIHelper
    {
        public static void FillGrid(ref DataGridView DGVtoShow, string[] ColoumnName, String[,] Content)
        {
            DGVtoShow.ColumnCount = ColoumnName.Length;
            DGVtoShow.RowCount = Content.GetLength(0);
            int index = 0;
            foreach (DataGridViewColumn DGVColloumn in DGVtoShow.Columns)
            {
                DGVColloumn.HeaderText = ColoumnName[index];
                index++;
            }

            for (int i = 0; i < Content.GetLength(0); i++)
            {
                for (int j = 0; j < ColoumnName.Length; j++)
                {
                    DGVtoShow[j, i].Value = Content[i, j];
                }
            }
        }
    }
}
